import * as API from './axiosInit';
import type { IObject } from '../utils/interface';

const apiList: IObject = {
  setOrgFormSchema: (param: IObject) => API.POST('/palm/orgFormSchema/save.json', param), // 保存Schema
  getOrgFormSchema: (param: IObject) => API.POST('/palm/orgFormSchema/get.json', param), // 获取Schema
  savePackage: (param: IObject) => API.POST('/palm/orgFormSchema/savePackage.json', param), // 保存/更新 表单package
  getPackage: (param: IObject) => API.POST('/palm/orgFormSchema/getPackage.json', param), // 获取表单package
  navigator: (param: IObject) => API.POST('/palm/orgForm/navigator.json', param), // 导航
};

// : (param: IObject) => API.POST('', param), //

const NetWorkReq = (name: string, param: IObject = {}, headers?: IObject): Promise<IObject> =>
  apiList[name](param, headers);

export default NetWorkReq;
